<?php
include '../common/database.php';
$app_id=$_GET['appid'];
$version_id=$_GET['versionid'];
global $db;
$query = "SELECT * FROM version WHERE app_id='$app_id' and id>'$version_id' and state='1' ORDER BY id DESC LIMIT 1 ";
$dataselect = $db->query($query) or die('null');
$row = $dataselect ->rowCount();
if ($row<1){
    echo 'null';
}else{
    $data = $dataselect ->fetchAll();
    $json_response;
    foreach ($data as $value) {
        $json_response['id'] =$value['id'];
        $json_response['name'] =$value['name'];
        $json_response['date'] =$value['date'];

    }
    echo json_encode($json_response);
}
?>	